# A nonpartisan legislative chamber: The influence of the Canadian Senate replication file

This replication file contains all the files and data necessary for the replication of the A nonpartisan legislative chamber: The influence of the Canadian Senate paper, published in Party Poltiics.

To reproduce the analyses there are two options: with or without packrat. The packrat method requires the packrat package but is a permanent stable version of the replication that includes all the libraries and packages required as they were at the time of the papers publication.

With packrat:
* Run the command <packrat::unbundle("senate_replication.tar.gz")> in R to unbundle and install all the packages in a local library. This will take some time.
* Open the newly unzipped folder and open senate.Rproj in RStudio
* Run prep.Rmd to recode and otherwise modify the raw data files and save them as .rds files in the data/transformed/ directory
* Run analysis.Rmd to produce all tables and figures for the table.

Without packrat:
* Open senate.Rproj in RStudio
* Modify the paths for the files you downloaded and then run prep.Rmd, to recode and otherwise modify the raw data files and save them as .rds files in the data/transformed/ directory. You may need to install packages that you do not already have and subsequent package changes may break the code.
* Run analysis.Rmd to produce all tables and figures for the paper. Again, you may need to install packages that you do not already have and subsequent package changes may break the code.
